<!DOCTYPE html>
<html>

<head>
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  <title>新物品录入</title>
  <meta charset="UTF-8" />
</head>
{% if messages %}
{% for msg in messages %}
<script>
  alert('{{ msg.message }}');
</script>
{% endfor %}
{% endif %}

<body>
  <fieldset style="padding: 2">
    <legend>快捷链接</legend>
    <p><a href="all_objects">所有物品</a> <a href="warning_objects">当前告警物品</a></p>
  </fieldset>
  <form action="/add_object" method="post">
    {% csrf_token %}
    <fieldset style="padding: 2">
      <legend>新物品录入</legend>
      <p>{{ obj.name.label }} {{ obj.name }}</p>
      <p>{{ obj.place.label }} {{ obj.place }}</p>
      <p>{{ obj.type.label }} {{ obj.type }}</p>
      <p>{{ obj.count.label }} {{ obj.count }} {{ obj.unit }}</p>
      <fieldset style="padding: 2">
        <legend>有效期</legend>
        <p>{{ obj.valid.label }} {{ obj.valid }} 如：20220302</p>
        <p>或 {{ obj.spec_days }} 天</p>
        <p>或 {{ obj.spec_weeks }} 周</p>
        <p>或 {{ obj.spec_months }} 月</p>
        <p>或 {{ obj.forever }} 不过期</p>
      </fieldset>
      <p>{{ obj.note.label }} {{ obj.note }} 如：数量小于5个告警、有效期小于1个月告警……</p>
      <p><input type="submit" value="提交" name="B1" style="float: left">
        <input type="button" value="返回" name="B2" style="float: right" onclick="history.back()">
      </p>
    </fieldset>
  </form>
</body>

</html>